﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace JustTank
{
    public class Bullet : MovingObject
    {
        public new const string CollisionGroupString = "bullet";
        public ConsoleColor Color = ConsoleColor.White;
        
        private TankDirection direction;

        public TankDirection Direction
        {
            get { return this.direction; }
        }
        
        public Bullet(MatrixCoords topLeft, TankDirection direction)
            : base(topLeft, new char[,] { { '.' } }, new MatrixCoords(0, 0))
        {
            this.direction = direction;
        }

        public override void Update()
        {
            switch (this.direction)
            {
                case TankDirection.Left:
                    this.topLeft.Col--;
                    break;
                case TankDirection.Right:
                    this.topLeft.Col++;
                    break;
                case TankDirection.Up:
                    this.topLeft.Row--;
                    break;
                case TankDirection.Down:
                    this.topLeft.Row++;
                    break;
                default:
                    break;
            }
        }

        
    }
}
